package com.beiing.tianshuai.tianshuai.mine.presenter;

import com.beiing.tianshuai.tianshuai.base.BasePresenter;
import com.beiing.tianshuai.tianshuai.entity.PersonalAuditBean;
import com.beiing.tianshuai.tianshuai.mine.model.PersonalAuditModel;
import com.beiing.tianshuai.tianshuai.mine.model.PersonalAuditModelImpl;
import com.beiing.tianshuai.tianshuai.mine.view.PersonalAuditViewImpl;

/**
 * Created by Administrator on 2018/1/3 0003.
 */

public class PersonalAuditPresenter extends BasePresenter implements PersonalAuditPresenterImpl, PersonalAuditModel.OnPersonalAuditResponseListener {

    private PersonalAuditViewImpl mView;
    private PersonalAuditModelImpl mModel;

    public PersonalAuditPresenter(PersonalAuditViewImpl view) {
        mView = view;
        mModel = new PersonalAuditModel(this);
    }

    @Override
    public void requestData(String uid, String typeName, String search, int pageSize, int page) {
        mView.showProgress();
        mModel.requestData(uid, typeName, search, pageSize, page);
    }

    @Override
    public void onRequestDataSuccess(PersonalAuditBean bean) {
        mView.hideProgress();
        mView.onRequestSuccess(bean);
    }

    @Override
    public void onRequestDataFailed(Throwable throwable) {
        mView.hideProgress();
        mView.onRequestFailed(throwable);
    }
}
